<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/5/18
 * Time: 21:40
 */
namespace app\admin\model;

use think\Model;

class MassSend extends Model
{
    //上传图文消息素材【订阅号与服务号认证后均可用】
    public function uploadNewsData()
    {
        $data = ['articles'=>[
            [
                'thumb_media_id'=>'OP0BeXqLxaDwWvMVhG3Tzlcl89JJNLjwzfDHcEj-VCLKTUEs4XKWmeMzSiNdSgcJ',
                'author'=>'xxx',
                'title' => 'Happy Day',
                'content_source_url'=>'www.qq.com',
                'content'=>'content',
                'digest'=>'digest',
                'show_cover_pic'=>'1'
            ],
            [
                'thumb_media_id'=>'OP0BeXqLxaDwWvMVhG3Tzlcl89JJNLjwzfDHcEj-VCLKTUEs4XKWmeMzSiNdSgcJ',
                'author'=>'xxx',
                'title' => 'Happy Day',
                'content_source_url'=>'www.qq.com',
                'content'=>'content',
                'digest'=>'digest',
                'show_cover_pic'=>'0'
            ]
        ]];
        return $data;
    }

    //根据OpenID列表群发【订阅号不可用，服务号认证后可用】
    public function send()
    {
        $data = [
            'touser'=>['oZYXqjjufrUPXtEOvuiImGijgaDk','oZYXqjmAkBKt7ndgBF89J43eLB4w'],
            'msgtype'=>'text',
            'text'=>[
                'content'=>'欢迎你关注了我，跃飞'
            ]
        ];
        return $data;
    }

    //图文消息
    public function sendMpNewsData()
    {
        $data = [
            'touser'=>['oZYXqjjufrUPXtEOvuiImGijgaDk','oZYXqjmAkBKt7ndgBF89J43eLB4w','oZYXqjo1Pv4wOszs-xhV7FL0t12Y','oZYXqjr0JD_tCsnC-C9UfwbJGaA4','oZYXqjm0oxRfYwCcnnnVRnR7g4jA'],
            'mpnews'=>[
                'media_id'=>'Ox02LlDsXk4bgMXT0ER-i3IVrPeck-Z-rHrwz8FzUQwylyUgoCS1HTN3uIZawS5K'
            ],
            'msgtype'=>'mpnews',
            'send_ignore_reprint'=> '0'
        ];
        return $data;
    }

    //图片消息
    public function sendImageData()
    {
        $data = [
            'touser'=>['oZYXqjjufrUPXtEOvuiImGijgaDk','oZYXqjmAkBKt7ndgBF89J43eLB4w'],
            'image'=>[
                'media_id'=>'IbDmZTj2ZCPD_xEtXCBYKtDmfgytxL-SBvqTRnwoBSw_flbqJ1VIF9zR6Pk0IolL' //上传图片接口返回的
            ],
            'msgtype'=>'image',
        ];
        return $data;
    }
}